Optimal. Leaf size=103 \[ \frac{b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}-\frac{4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+x \left (-6 a^2 b^2+a^4+b^4\right )+\frac{b (a+b \tan (c+d x))^3}{3 d}+\frac{a b (a+b \tan (c+d x))^2}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.156476, antiderivative size = 103, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.179, Rules used = {3086, 3482, 3528, 3525, 3475} \[ \frac{b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}-\frac{4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+x \left (-6 a^2 b^2+a^4+b^4\right )+\frac{b (a+b \tan (c+d x))^3}{3 d}+\frac{a b (a+b \tan (c+d x))^2}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3086
Rule 3482
Rule 3528
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int \sec ^4(c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx &=\int (a+b \tan (c+d x))^4 \, dx\\ &=\frac{b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x))^2 \left (a^2-b^2+2 a b \tan (c+d x)\right ) \, dx\\ &=\frac{a b (a+b \tan (c+d x))^2}{d}+\frac{b (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (a \left (a^2-3 b^2\right )+b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=\left (a^4-6 a^2 b^2+b^4\right ) x+\frac{b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac{a b (a+b \tan (c+d x))^2}{d}+\frac{b (a+b \tan (c+d x))^3}{3 d}+\left (4 a b \left (a^2-b^2\right )\right ) \int \tan (c+d x) \, dx\\ &=\left (a^4-6 a^2 b^2+b^4\right ) x-\frac{4 a b \left (a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac{b^2 \left (3 a^2-b^2\right ) \tan (c+d x)}{d}+\frac{a b (a+b \tan (c+d x))^2}{d}+\frac{b (a+b \tan (c+d x))^3}{3 d}\\ \end{align*}
Mathematica [C] time = 0.39153, size = 105, normalized size = 1.02 \[ \frac{-6 b^2 \left (b^2-6 a^2\right ) \tan (c+d x)+12 a b^3 \tan ^2(c+d x)+3 i (a-i b)^4 \log (\tan (c+d x)+i)-3 i (a+i b)^4 \log (-\tan (c+d x)+i)+2 b^4 \tan ^3(c+d x)}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.14, size = 145, normalized size = 1.4 \begin{align*}{a}^{4}x+{\frac{{a}^{4}c}{d}}-4\,{\frac{{a}^{3}b\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-6\,{a}^{2}{b}^{2}x+6\,{\frac{\tan \left ( dx+c \right ){a}^{2}{b}^{2}}{d}}-6\,{\frac{{a}^{2}{b}^{2}c}{d}}+2\,{\frac{a{b}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{d}}+4\,{\frac{a{b}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{{b}^{4} \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{3\,d}}-{\frac{{b}^{4}\tan \left ( dx+c \right ) }{d}}+{b}^{4}x+{\frac{{b}^{4}c}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.83705, size = 157, normalized size = 1.52 \begin{align*} \frac{3 \,{\left (d x + c\right )} a^{4} - 18 \,{\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} b^{2} +{\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} b^{4} - 6 \, a b^{3}{\left (\frac{1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} - 6 \, a^{3} b \log \left (-\sin \left (d x + c\right )^{2} + 1\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.514935, size = 282, normalized size = 2.74 \begin{align*} \frac{3 \,{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d x \cos \left (d x + c\right )^{3} + 6 \, a b^{3} \cos \left (d x + c\right ) - 12 \,{\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (-\cos \left (d x + c\right )\right ) +{\left (b^{4} + 2 \,{\left (9 \, a^{2} b^{2} - 2 \, b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.19885, size = 140, normalized size = 1.36 \begin{align*} \frac{b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - 3 \, b^{4} \tan \left (d x + c\right ) + 3 \,{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )}{\left (d x + c\right )} + 6 \,{\left (a^{3} b - a b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]